Skip to content

feat: add live plugin json validation - #32

Merged
jinbagi merged 1 commit into
masterfrom
codex/plugin-json-live-validation
Jul 3, 2026
Merged

feat: add live plugin json validation#32
jinbagi merged 1 commit into
masterfrom
codex/plugin-json-live-validation

Conversation

@jinbagi

@jinbagi jinbagi commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • watch plugin JSON editor contents and surface syntax, schema, AI Gateway, and compatibility issues before save
  • show a compact warning summary in the JSON tab for long plugin configs, capped at five inline issues
  • extend plugin metadata E2E to verify invalid JSON is flagged before the save attempt

Verification

  • .\node_modules.bin\tsc.CMD -b --pretty false
  • .\node_modules.bin\eslint.CMD src/components/form-slice/FormItemPlugins/PluginEditorDrawer.tsx e2e/tests/plugin_metadata.crud-all-fields.spec.ts --max-warnings=0 --no-warn-ignored
  • E2E_TARGET_URL=http://127.0.0.1:55173/ui/ playwright test e2e/tests/plugin_metadata.crud-all-fields.spec.ts --config=.tmp-playwright-chrome.config.ts --project=chrome --reporter=list --workers=1
  • corepack pnpm lint
  • corepack pnpm build

Copilot AI review requested due to automatic review settings July 3, 2026 11:41
@jinbagi
jinbagi merged commit c0bca63 into master Jul 3, 2026
1 check passed
@jinbagi
jinbagi deleted the codex/plugin-json-live-validation branch July 3, 2026 11:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds “live” validation feedback for plugin JSON configs in the plugin editor drawer, so users can see JSON syntax + semantic config issues before attempting to save, with an accompanying E2E assertion.

Changes:

  • Watch the JSON editor field and compute live validation results (syntax, schema, AI Gateway, compatibility) when on the JSON tab.
  • Render a compact warning Alert that summarizes validation issues and shows up to 5 inline items.
  • Extend the plugin metadata E2E to confirm invalid JSON shows the new “Fix JSON syntax before saving.” warning prior to clicking “Add Plugin”.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/components/form-slice/FormItemPlugins/PluginEditorDrawer.tsx Adds watched JSON editor validation + capped warning summary UI in the plugin drawer.
e2e/tests/plugin_metadata.crud-all-fields.spec.ts Adds an assertion that the new pre-save JSON syntax warning appears for invalid JSON.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +305 to +311
const jsonValidation = useMemo(() => {
if (activeTab !== 'json' || mode === 'view') return null;

let parsed: unknown;
try {
parsed = JSON.parse(jsonConfigText || '{}');
} catch (error) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants